<template>

    <div>
      <h6>您未登录</h6>
    <p>将在 {{num}} 秒后返回</p>
    </div>

</template>

<script>
export default {
    data () {
        return {
            num: 5
        }
    },
    mounted () {
        setInterval(() => {
            this.num--
        }, 1000)
    },

    methods: {

    },
    watch: {
        num: {
            handler() {
                if (this.num === 0) {
                    this.$router.push('/')
                }
            },
            immediate: true
        }
    }
}
</script>

<style scoped lang="less">

</style>
